using System;
using System.Collections.Generic;
using System.Text;
using PostSharp4Spring.Sample.Services;

namespace PostSharp4Spring.Sample.Domain
{
    [Serializable]
    [Configurable]
    public class Person
    {
        public string Name
        {
            get { return name; }
            set { name = value; }
        } private string name;

        public Person(string name)
        {
            this.name = name;
        }

        public IGreetingService GreetingService
        {
            get { return greetingService; }
            set { greetingService = value; }
        } [NonSerialized] private IGreetingService greetingService;

        public override string ToString()
        {
            return GreetingService.Greet(this) + " " + GetHashCode();
        }
    }
}
